import React from 'react';
import { Routes, Route, Navigate } from 'react-router-dom';
import { Layout } from 'antd';
import AlarmList from './AlarmList';
import AlarmStatistics from './AlarmStatistics';
import AlarmRules from './AlarmRules';

const { Content } = Layout;

const Alarm: React.FC = () => {
  return (
    <Layout style={{ minHeight: 'calc(100vh - 64px)', background: '#f0f2f5' }}>
      <Content style={{ padding: '24px', margin: 0, minHeight: 280 }}>
        <Routes>
          <Route index element={<Navigate to="list" replace />} />
          <Route path="list" element={<AlarmList />} />
          <Route path="statistics" element={<AlarmStatistics />} />
          <Route path="rules" element={<AlarmRules />} />
        </Routes>
      </Content>
    </Layout>
  );
};

export default Alarm;